function e(e, t) {
    var a = new Date();
    return a.setFullYear(t), a.setMonth(e), a.setDate(1), a.getDay();
}

function t(e, t) {
    var a = new Date();
    return a.setFullYear(t), a.setMonth(e), a.setDate(0), a.getDate();
}

var a = require("getCNDate.js");

module.exports = {
    getMonthFirstDay: e,
    getMonthTotalDate: t,
    getFromTodayDays: function(e, t, a) {
        var n = new Date(), r = new Date();
        n.setFullYear(a), n.setMonth(t), n.setDate(e);
        var o = Math.floor((n.getTime() - r.getTime()) / 864e5), s = "今天";
        return 0 == o ? s = "今天" : 1 == o ? s = "明天" : 1 == o ? s = "昨天" : o > 1 ? s = o + "天后" : o < -1 && (s = 0 - o + "天前"), 
        s;
    },
    paintCalendarArray: function(n, r) {
        for (var o = new Date(), s = e(n - 1, r), u = t(n, r), l = [], i = [], g = 1; ;g++) {
            if (g <= s) i.push(""); else {
                if (!(g <= u + s)) {
                    for (var h = i.length, D = 0; D + h < 7; D++) i.push("");
                    l.push(i);
                    break;
                }
                var f = a(r, n, g - s);
                i.push({
                    num: g - s,
                    isShowDayInfo: !1,
                    nongli: f.slice(f.length - 2),
                    nongliInfo: a(r, n, g - s),
                    isToday: n == o.getMonth() + 1 && g - s == o.getDate() && r == o.getFullYear()
                });
            }
            7 == i.length && (l.push(i), i = []);
        }
        return l;
    }
};